<?php
/**
 * Notes:
 * User: LiaoHong
 * Date: 2025/10/24
 * Time: 10:13
 **/


namespace App\Http\Controllers\Pull;


use App\Http\Controllers\Controller;
use App\Services\Pull\PullService;
use Illuminate\Http\Request;

class PullController extends Controller
{

    /** @var PullService */
    private PullService $pushService;

    public function __construct(PullService $service)
    {
        $this->pushService = $service;
    }

    /**
     * @Notes:获取项目列表
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @author: Liao Hong
     * @Time: 2025/10/24   10:19
     * @Interface receiveData
     */
    public function getProject(){
        return success($this->pushService->getProject());
    }

    /**
     * @Notes:获取文件夹信息
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @author: Liao Hong
     * @Time: 2025/10/24   14:39
     * @Interface getFolder
     */
    public function getFolder(Request $request)
    {
        $params = $request->input();
        return success($this->pushService->getFolder($params));
    }

    /**
     * @Notes:获取案卷数据
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @throws \Exception
     * @author: Liao Hong
     * @Time: 2025/10/24   16:30
     * @Interface getFileList
     */
    public function getArchivesAdmin(Request $request)
    {
        $params = $request->input();
        return success($this->pushService->getArchivesAdmin($params));
    }

    /**
     * @Notes:获取卷内数据
     * @param Request $request
     * @author: Liao Hong
     * @Time: 2025/10/24   17:25
     * @Interface getArchivesFile
     */
    public function getArchivesFile(Request $request)
    {
        $params = $request->input();
        return success($this->pushService->getArchivesFile($params));
    }

}
